Skip to content

Enable the imperative EventTarget API in canary - #58479

Closed
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D119645412
Closed

Enable the imperative EventTarget API in canary#58479
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D119645412

Conversation

@rubennorte

Copy link
Copy Markdown
Member

Summary:
enableImperativeEvents was defined as a JS-only feature flag, but OSS release stages are only applied to common flags: ossReleaseStage is consumed exclusively by the generators that produce the native override classes, so setting it on a JS-only flag is silently a no-op. The feature could therefore never be shipped through the canary channel.

This defines enableImperativeEvents as a common flag at release stage canary, and renames the JS-only flag to enableImperativeEvents_DEPRECATED. The deprecated flag is kept because the common flag is read through the native module: a JS bundle delivered to a native build that predates this change finds no such method and falls back to the default, which would silently turn the feature off. The gate in ReactNativeElement and ReadOnlyText now keeps the public EventTarget methods when either flag is enabled.

Changelog:
[General][Added] - Enable the imperative EventTarget API (addEventListener, removeEventListener, dispatchEvent) on native view refs in canary

Differential Revision: D119645412

Summary:
`enableImperativeEvents` was defined as a JS-only feature flag, but OSS release stages are only applied to common flags: `ossReleaseStage` is consumed exclusively by the generators that produce the native override classes, so setting it on a JS-only flag is silently a no-op. The feature could therefore never be shipped through the canary channel.

This defines `enableImperativeEvents` as a common flag at release stage `canary`, and renames the JS-only flag to `enableImperativeEvents_DEPRECATED`. The deprecated flag is kept because the common flag is read through the native module: a JS bundle delivered to a native build that predates this change finds no such method and falls back to the default, which would silently turn the feature off. The gate in `ReactNativeElement` and `ReadOnlyText` now keeps the public EventTarget methods when either flag is enabled.

Changelog:
[General][Added] - Enable the imperative EventTarget API (`addEventListener`, `removeEventListener`, `dispatchEvent`) on native view refs in canary

Differential Revision: D119645412
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 11, 2026
@meta-codesync

meta-codesync Bot commented Sep 11, 2026

Copy link
Copy Markdown

@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D119645412.

@meta-codesync meta-codesync Bot closed this in 8480b86 Sep 11, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Sep 11, 2026
@meta-codesync

meta-codesync Bot commented Sep 11, 2026

Copy link
Copy Markdown

This pull request has been merged in 8480b86.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant